package io.renren.modules.manage.service.impl;

import io.renren.modules.manage.entity.ProductCategoryEntity;
import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.Query;

import io.renren.modules.manage.dao.FreshUserDao;
import io.renren.modules.manage.entity.FreshUserEntity;
import io.renren.modules.manage.service.FreshUserService;


@Service("freshUserService")
public class FreshUserServiceImpl extends ServiceImpl<FreshUserDao, FreshUserEntity> implements FreshUserService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        String key = params.get("key").toString();
        QueryWrapper<FreshUserEntity> queryWrapper = new QueryWrapper<>();
        if (key.length() > 0) {
            queryWrapper.like("username", key);
        }
        IPage<FreshUserEntity> page = this.page(
                new Query<FreshUserEntity>().getPage(params),
                new QueryWrapper<FreshUserEntity>()
        );

        return new PageUtils(page);
    }

}
